// 用户信息接口
export interface UserInfo {
  id: number;
  username: string;
  email: string;
  nickname?: string;
  phone?: string;
  avatar?: string;
  role: 'user' | 'admin';
  createdAt: string;
  updatedAt: string;
  level?: string; 
  gender?: string; 
  birthday?: string;
  emailVerified?: boolean;
}

// 地址接口
export interface Address {
  id: number;
  userId: number;
  name: string;
  phone: string;
  province: string;
  city: string;
  district: string;
  detail: string;
  isDefault: boolean;
}

// 商品接口
export interface Product {
  id: number;
  name: string;
  description: string;
  price: number;
  originalPrice?: number;
  images: string[];
  categoryId: number;
  stock: number;
  sales: number;
  rating: number;
  status: 'on' | 'off';
  createdAt: string;
  updatedAt: string;
}

// 订单项接口
export interface OrderItem {
  id: number;
  orderId: number;
  productId: number;
  productName: string;
  productPrice: number;
  quantity: number;
  productImage: string;
  specifications?: Record<string, string>;
}

// 订单接口
export interface Order {
  id: number;
  userId: number;
  totalAmount: number;
  status: 'pending' | 'paid' | 'shipped' | 'delivered' | 'canceled';
  paymentMethod: string;
  shippingAddress: Address;
  orderItems: OrderItem[];
  createdAt: string;
  updatedAt: string;
  paidAt?: string;
  shippedAt?: string;
  deliveredAt?: string;
}